package com.zjj.mapper;

import com.zjj.entity.User;
import com.zjj.entity.UserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    int add(@Param("user") User user);
    int delete(@Param("id") int id);
    int update(@Param("user") User user);
    @Select(" select u.id as id,u.name as name,r.name as roleName " +
            "        from user u,role r " +
            "        where u.roleId = r.id")
    List<UserDTO> select();
}
